<import file="block/common.html" name="url"/>
<div class="layui-fluid">
    <div class="layui-form">
		<div class="layui-form-item">
            <label class="layui-form-label required">登录名</label>
            <div class="layui-input-inline">
                <input type="text" name="nickname" lay-verify="required" value="<{$info['username']}>" disabled="" class="layui-input"> 
            </div>
            <div class="layui-form-mid layui-word-aux">用户不能自行修改登录名，如需修改，请联系系统管理员</div>
        </div>
		<div class="layui-form-item">
            <label class="layui-form-label required">昵称</label>
            <div class="layui-input-inline">
                <input type="text" name="nickname" lay-verify="required" lay-reqtext="昵称不能为空" placeholder="请输入昵称" value="<{$info['nickname']}>" class="layui-input">
            </div><div class="layui-form-mid layui-word-aux">一般为真实姓名</div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
			<input type="text" name="password" value="" class="layui-input">
            </div><div class="layui-form-mid layui-word-aux">必须为8-16位字符（英文/数字/符号）至少两种或下划线组合</div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
			<input type="hidden" name="id" value="<{$info['id']}>">
                <button class="layui-btn" lay-submit lay-filter="saveBtn"><?php echo lang('save');?></button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;

        form.render();

        //监听提交
        form.on('submit(saveBtn)', function (data) {
			$.post('<{caUrl("adminuser","passwordedit")}>',data.field,function(res){
                if(res.status == 1){
                    layer.msg(res.info, {icon: 1, time: 1000},function(){
						loadMain('<{caUrl("index","home")}>');
					});
                }else{
                    layer.msg(res.info, {icon: 2, anim: 6, time: 5000});
                }
            });
            return false;
        });

    });
</script>